package model.Board;

import java.io.FileNotFoundException;
import java.io.IOException;

import model.Settings.BoardConfigurations;

/**
 * The model of the board that contains all the ships and water.
 * 
 * @author Peter-John Rowe
 *
 */
public class BoardModel {

	private Cell[][] m_aoBoardCells;
	private int m_nBoardSize;
	private BoardConfigurations m_oConfiguration;
	
	/**
	 * Board model constructor that initialises the size of the board.
	 * 
	 * @param a_nBoardSize - the new size of the board
	 * @throws IOException 
	 * @throws FileNotFoundException 
	 */
	public BoardModel() throws FileNotFoundException, IOException {
		m_oConfiguration = new BoardConfigurations();
		m_nBoardSize = m_oConfiguration.getBoardSize();
		m_aoBoardCells = new Cell[m_nBoardSize][m_nBoardSize];
	}
	
	/**
	 * Gets the size of the board.
	 * 
	 * @return m_nBoardSize
	 */
	public int getBoardSize() {
		return m_nBoardSize;
	}
	
	/**
	 * Gets a cell in the board based on its row and column
	 * 
	 * @param a_nRow - row coordinate
	 * @param a_nColumn - column coordinate
	 * @return oBoardCell - the board cell
	 */
	public Cell getBoardCell(int a_nRow,int a_nColumn) {
		Cell oBoardCell = m_aoBoardCells[a_nRow][a_nColumn];
		return oBoardCell;
	}
	
	/**
	 * Sets a cell of the board.
	 * 
	 * @param a_oBoardCell - the new cell
	 * @param a_nRow - row coordinate
	 * @param a_nColumn - column coordinate
	 */
	public void setBoardCell(Cell a_oBoardCell,int a_nRow,int a_nColumn) {
		m_aoBoardCells[a_nRow][a_nColumn] = a_oBoardCell;
	}
	
	/**
	 * Configure the boards based on the parameters in the properties file.
	 * 
	 * @throws IOException 
	 * @throws FileNotFoundException 
	 */
	public void configureBoard() throws FileNotFoundException, IOException {
		
		
		
		
	}
	
} // BoardModel Class
